/**此模块负责ajax*/
//var rule =[
//    {path:'users',remote:'/service/getUser'}
//]
var Request = require('../libs/request.js');
module.exports = function(req, res){
    var postData = res.body||{};
    var path = req.path;
    console.log("ajax path: " + path);
    Request({
        url:path,
        data:postData,
        success:function(data){
            res.json(data);
            res.end();
        },
        error:function(err){
            res.json(err);
            res.end();
        }
  })
}